<?php

namespace HelloAdmin\Model;
use \Common\Model\XuecheModel;

class CrontabModel extends XuecheModel {

    protected $pk = 'id';
    protected $tableName = 'crontab';
    protected $fields = array(
        'id','url','type','disabled','ctime','dotime','remark'
    );

    /**
     * 清空数据缓存
     *
     */
    public function ClearAllCache() {

    }

    //缓存设置
    protected $_useCacheType = 'file';
    protected $_catheTime = 0;

    public function Validate($data) {

        return true;
    }

    static public function updateData($data){
        if($data['id'] > 0 && empty($data['url'])){
            $OBJ = new self();
            return $OBJ->where("`id`='{$data['id']}'")->save($data);
        }
        return false;
    }




}
